package main
import ("fmt")

type person struct{
	name string
	age int
}

func newPerson(name string) *person{
	p := person{
		name: name,
	}
	p.age = 666

	return &p
}

func main(){

	fmt.Println(person{
		"Bob",
		12,
	})
	fmt.Println(person{
		name: "Alice",
		age: 10,
	})
	fmt.Println(person{
		name: "Fred",
	})
	fmt.Println(&person{"Ann",24})
	fmt.Println(newPerson("Joe"))

	me := person{"alan",24}
	fmt.Println("name:",me.name," age:",me.age)

	cloneMe := me
	fmt.Println(cloneMe)

	me.age = 18
	fmt.Println(cloneMe.age)

	refMe := &me
	fmt.Println(refMe)

	me.age = 100
	fmt.Println(refMe.age)
	
}